const processElements = document.querySelectorAll(".process-line");

function processController() {
  processElements.forEach((element) => {
    const parentWidth = element.parentElement.clientWidth;
    let processWidth = element.clientWidth;
    if (processWidth === parentWidth) {
      element.style.width = "0";
      return;
    }
    let newProcessWidth = processWidth + Math.random() * parentWidth * 0.2;
    if (newProcessWidth > parentWidth) {
      newProcessWidth = parentWidth;
    }
    element.style.width = newProcessWidth + "px";
  });
}

const processEvent = setInterval(() => {
  processController();
}, 300);
